package main

import (
	"bookstore/server/conf"
	"bookstore/server/routes"
	"github.com/sirupsen/logrus"
	"os"
)

func main() {
	// 初始化logrus
	logrus.SetFormatter(&logrus.JSONFormatter{})
	logrus.SetOutput(os.Stdout)
	logrus.SetLevel(logrus.DebugLevel)

	// 从配置文件读入配置
	conf.Init()
	// gin 框架web应用 路由
	router := routes.ApiRoutes()
	// http://localhost:8080/swagger/index.html
	_ = router.Run(conf.HttpPort)
}
